<?php
class ui_hot_circle extends ui {
	public function __construct($S, $param) {
		parent::__construct();
		
		if ($this->uid) {
			if ($param['scr_w'] > 1200) {
				$S->assign('cols', 2);			// 两列输出
			} else {
				$S->assign('cols', 1);			// 1列输出
			}
			$data_guest = new data_guest();
			$circles = $data_guest->ls_circle();
			// 重新整理circles
			if (is_array($circles)) {
				foreach ($circles as $k=>$v) {
					if (is_array($v['articles'])) {			// 找出articles中的一张大图
						foreach ($v['articles'] as $a) {
							if ($a['img_0']) {
								$circles[$k]['big_img'] = $a['img_0'];
								break;			// 只记录一个即可
							}
						}
					}
				}
			}
			$S->assign('circles', $circles);

		} else die();
	}
}
?>
